package org.ppassantini.cham.core.business.secutity.service.impl;

import org.dozer.Mapper;
import org.ppassantini.cham.core.business.security.dao.MenuDao;
import org.ppassantini.cham.core.business.security.dto.MenuDto;
import org.ppassantini.cham.core.business.security.entity.Menu;
import org.ppassantini.cham.core.business.secutity.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ppassantini
 *
 */
@Service("menuService")
public class MenuServiceImpl implements MenuService {

	@Autowired
	private MenuDao menuDao;

	@Autowired
	private Mapper mapper;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.ppassantini.cham.core.business.secutity.service.MenuService#addNewMenu
	 * (org.ppassantini.cham.core.business.security.dto.MenuDto)
	 */
	@Override
	public void addNewMenu(MenuDto menu) {
		Menu menuEntity = mapper.map(menu, Menu.class);
		menuDao.save(menuEntity);
	}

}
